knot: backport patch to fix linking with libhiredis
authorJan Hák <[email protected]>
Thu, 25 Sep 2025 12:09:21 +0000 (14:09 +0200)
committerJosef Schlehofer <[email protected]>
Fri, 26 Sep 2025 13:51:57 +0000 (15:51 +0200)
It was discovered that even while using ``--enable-redis=no``
and ``--disable-redis`` that it was still linking with libhiredis.

This avoids to picking up libhiredis as dependency:

```
Package knot is missing dependencies for the following libraries:
libhiredis.so.1.1.0
```

Fixes: cbbd2b5b3bd6df7e550b114cf1c9f8e0f5bc8616 ("knot: disable redis as it was enabled since 3.5.0 by default")
Signed-off-by: Jan Hák <[email protected]>
net/knot/patches/04_configure_fix_linking_with_libhiredis.patch [new file with mode: 0644]

diff --git a/net/knot/patches/04_configure_fix_linking_with_libhiredis.patch b/net/knot/patches/04_configure_fix_linking_with_libhiredis.patch
new file mode 100644 (file)
index 0000000..8c11efa
--- /dev/null
@@ -0,0 +1,25 @@
+From e1e8a763086efd91b3b167ec238c10d46c6e6a31 Mon Sep 17 00:00:00 2001
+From: Daniel Salzman <[email protected]>
+Date: Fri, 26 Sep 2025 14:46:20 +0200
+Subject: [PATCH] configure: fix linking with libhiredis if --disable-redis
+
+---
+ configure.ac | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -264,11 +264,9 @@ AC_ARG_ENABLE([redis],
+    AS_HELP_STRING([--enable-redis=auto|yes|no], [enable Redis support [default=auto]]),
+    [], [enable_redis=auto])
+-PKG_CHECK_MODULES([hiredis], [hiredis], [have_hiredis=yes], [have_hiredis=no])
+-
+ AS_CASE([$enable_redis],
+-   [auto], [AS_IF([test "$have_hiredis" = "yes"], [enable_redis=yes], [enable_redis=no])],
+-   [yes],  [AS_IF([test "$have_hiredis" = "yes"], [enable_redis=yes], [AC_MSG_ERROR([libhiredis not available])])],
++   [auto], [PKG_CHECK_MODULES([hiredis], [hiredis], [enable_redis=yes], [enable_redis=no])],
++   [yes],  [PKG_CHECK_MODULES([hiredis], [hiredis], [enable_redis=yes], [AC_MSG_ERROR([libhiredis not available])])],
+    [no], [],
+    [*], [AC_MSG_ERROR([Invalid value of --enable-redis.])]
+ )